<template>
	<el-drawer title="车辆维护详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form-item label="保养标题" prop="title">{{form.title}}</el-form-item>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="车牌号码" prop="vehicleNumber">{{form.vehicleNumber}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="保养类型" prop="repairType">{{form.repairTypeName}}</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="经办人" prop="repairUser">{{form.repairUserName}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="维修时间" prop="repairTime">{{form.repairTime}}</el-form-item>
					</el-col>
				</el-row>
				<el-form-item label="保养原因" prop="reason">{{form.reason}}</el-form-item>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="供应商" prop="repairSupplier">{{form.repairSupplier}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="保养金额" prop="repairPay">{{form.repairPay}}/元</el-form-item>
					</el-col>
				</el-row>
				<el-form-item label="备注说明" prop="remark">{{form.remark}}</el-form-item>
				<el-form-item label="相关附件" prop="attachId">
					<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
				</el-form-item>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'

export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			form: {
				recordId: '',
				vehicleId: '',
				vehicleNumber:'',
				title: '',
				repairType: '',
				repairTypeName: '',
				repairUserName: '',
				repairUser: '',
				repairTime: '',
				reason: '',
				repairSupplier: '',
				repairPay: 0,
				attachId: '',
				remark: '',
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model) {
			this.model = model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data) {
			this.form.recordId = data.recordId
			this.form.vehicleId = data.vehicleId
			this.form.vehicleNumber = data.vehicleNumber
			this.form.title = data.title
			this.form.repairType = data.repairType
			this.form.repairUser = data.repairUser
			this.form.repairTime = data.repairTime
			this.form.repairTypeName = data.repairTypeName
			this.form.repairUserName = data.repairUserName
			this.form.reason = data.reason
			this.form.repairSupplier = data.repairSupplier
			this.form.repairPay = data.repairPay
			this.form.attachId = data.attachId
			this.form.remark = data.remark
		},
	}
}
</script>

<style>
</style>
